/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package samoloty.view;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionListener;
import java.awt.event.FocusListener;

/**
 *
 * @author borysfan
 */
public class PaxPanel extends ContentPanel implements IContentPanel{

    public int identity = 3;
    private PaxSubPanel paxSubPanel;
    private PlotPanel plotPanel;

    public PaxPanel() {
        super();
        initPanel();
    }

    private void initPanel() {
        paxSubPanel = new PaxSubPanel();
        paxSubPanel.setPreferredSize(new Dimension(paxSubPanel.getPreferredSize().width, paxSubPanel.getPreferredSize().height - 300));
        paxSubPanel.setBounds(0,0,getWidth(),250);
        setLayout(null);

        add(paxSubPanel);
    }

    public void addInfoSubPanel(InfoSubPanel infoSubPanel) {
         infoSubPanel.setPreferredSize(new Dimension(289,289));
         infoSubPanel.setBounds(getWidth()-289,paxSubPanel.getHeight()-1,289,getHeight()-paxSubPanel.getHeight()+1);
         add(infoSubPanel);
    }

    public void reset() {
        paxSubPanel.reset();
    }

    public void addPaxWeightComboBoxItem(Object item){
        paxSubPanel.addPaxWeightComboBoxItem(item);
    }

    public Object getPaxWeightComboBoxSelected(){
        return paxSubPanel.getPaxWeightComboBoxSelected();
    }

    public String getMaleText(){
        return paxSubPanel.getMaleText();
    }

    public String getFemaleText(){
        return paxSubPanel.getFemaleText();
    }

    public String getChildText(){
        return paxSubPanel.getChildText();
    }

    public String getInfantText(){
        return paxSubPanel.getInfantText();
    }

    public String getCText(){
        return paxSubPanel.getCText();
    }

    public String getYText(){
        return paxSubPanel.getYText();
    }

    public String get0AText(){
        return paxSubPanel.get0AText();
    }

    public String get0BText(){
        return paxSubPanel.get0BText();
    }

    public String get0CText(){
        return paxSubPanel.get0CText();
    }

    public void setMaxCLab(String value){
        paxSubPanel.setMaxCLab(value);
    }

    public void setMaxYLab(String value){
        paxSubPanel.setMaxYLab(value);
    }

    public void setMaxOALab(String value){
        paxSubPanel.setMaxOALab(value);
    }

    public void setMaxOBLab(String value){
        paxSubPanel.setMaxOBLab(value);
    }

    public void setMaxOCLab(String value){
        paxSubPanel.setMaxOCLab(value);
    }

    public void setTTLPax1Text(String value){
        paxSubPanel.setTTLPax1Text(value);
    }

    public void setTTLPax2Text(String value){
        paxSubPanel.setTTLPax2Text(value);
    }

    public void setTTLPax3Text(String value){
        paxSubPanel.setTTLPax3Text(value);
    }



    public void setMaleFocusListener(FocusListener listener) {
        paxSubPanel.setMaleFocusListener(listener);
    }

    public void setFemaleFocusListener(FocusListener listener){
        paxSubPanel.setFemaleFocusListener(listener);
    }

    public void setChildFocusListener(FocusListener listener){
        paxSubPanel.setChildFocusListener(listener);
    }

    public void setInfantFocusListener(FocusListener listener){
        paxSubPanel.setInfantFocusListener(listener);
    }

    public void setCFocusListener(FocusListener listener){
        paxSubPanel.setCFocusListener(listener);
    }

    public void setYFocusListener(FocusListener listener){
        paxSubPanel.setYFocusListener(listener);
    }

    public void set0AFocusListener(FocusListener listener){
        paxSubPanel.set0AFocusListener(listener);
    }

    public void set0BFocusListener(FocusListener listener){
        paxSubPanel.set0BFocusListener(listener);
    }

    public void set0CFocusListener(FocusListener listener){
        paxSubPanel.set0CFocusListener(listener);
    }

    public void setPlotPanel(PlotPanel instance) {
        plotPanel = instance;
        plotPanel.setBounds(1,paxSubPanel.getHeight()-1,288,getHeight()-paxSubPanel.getHeight() );
        add(plotPanel);
    }

    public String get_vpaxm() {
        return paxSubPanel.get_vpaxm();
    }

    public String get_vpaxf() {
        return paxSubPanel.get_vpaxf();
    }

    public String get_vpaxch() {
        return paxSubPanel.get_vpaxch();
    }

    public String get_vpaxi() {
        return paxSubPanel.get_vpaxi();
    }

    public String get_vpaxc() {
        return paxSubPanel.get_vpaxc();
    }

    public String get_vpaxy() {
        return paxSubPanel.get_vpaxy();
    }

    public String get_vpax0a() {
        return paxSubPanel.get_vpax0a();
    }

    public String get_vpax0b() {
        return paxSubPanel.get_vpax0b();
    }

    public String get_vpax0c() {
        return paxSubPanel.get_vpax0c();
    }

    public String get_vttlpax1() {
        return paxSubPanel.get_vttlpax1();
    }

    public String get_vttlpax2() {
        return paxSubPanel.get_vttlpax2();
    }

    public String get_vttlpax3() {
        return paxSubPanel.get_vttlpax3();
    }

    public String get_vpaxweights() {
        return paxSubPanel.get_vpaxweights();
    }

    public void setPaxWeightsCombo(ActionListener listener) {
        paxSubPanel.setPaxWeightsCombo(listener);
    }

    public void setValidator_1_Text(String s){
        paxSubPanel.setValidator_1_Text(s);
    }

    public void setValidator_2_Text(String s){
        paxSubPanel.setValidator_2_Text(s);
    }

    public void setValidator_3_Text(String s){
        paxSubPanel.setValidator_3_Text(s);
    }

    public void setVisibleValidator_1(boolean value){
        paxSubPanel.setVisibleValidator_1(value);
    }

    public void setVisibleValidator_2(boolean value){
        paxSubPanel.setVisibleValidator_2(value);
    }

    public void setVisibleValidator_3(boolean value){
        paxSubPanel.setVisibleValidator_3(value);
    }

    public void setMaleBorder(Color c) {
        paxSubPanel.setMaleBorder(c);
    }

    public void setFemaleBorder(Color c) {
        paxSubPanel.setFemaleBorder(c);
    }

    public void setChildBorder(Color c) {
        paxSubPanel.setChildBorder(c);
    }

    public void setInfantBorder(Color c) {
        paxSubPanel.setInfantBorder(c);
    }

    public void setCBorder(Color c){
       paxSubPanel.setCBorder(c);
    }

    public void setYBorder(Color c){
       paxSubPanel.setYBorder(c);
    }

    public void setOABorder(Color c){
       paxSubPanel.setOABorder(c);
    }

    public void setOBBorder(Color c){
       paxSubPanel.setOBBorder(c);
    }

    public void setOCBorder(Color c){
       paxSubPanel.setOCBorder(c);
    }

    public void setPaxTTL_1_Border(Color c) {
        paxSubPanel.setPaxTTL_1_Border(c);
    }

    public void setPaxTTL_2_Border(Color c) {
        paxSubPanel.setPaxTTL_2_Border(c);
    }

    public void setPaxTTL_3_Border(Color c) {
        paxSubPanel.setPaxTTL_3_Border(c);
    }

    @Override
    public int getIdentity() {
        return identity;
    }

    public void firstFocused() {
        paxSubPanel.setFirstActiveField();
    }


    @Override
    public boolean isValid() {
        try {
            return paxSubPanel.isValid();
        } catch (NullPointerException e) {
            return false;
        }
    }
}
